<?php
class Users Extends Zend_Db_Table_Abstract
{
	const SALT = 'ZzjjpHf8QDH2CUQ9';
	
	public function createUser($email, $password)
	{
		$salt = $this->generateSalt();
		$data = array(
			'email' => $email,
			'password' => sha1(self::SALT . $password . $salt),
			'salt' => $salt,
		);
		$this->insert($data);
	}
	
	public function generateSalt()
	{
		return substr(md5(rand(0, 9999) . uniqid()), 0, 16);
	}
}